<?php
my_component_load('testing' , false);
my_component_load('paging' , false); 
my_component_load('data_setting', false);
my_component_load('org_status_karyawan' );

$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;
$modulname = "Admin _BN_ Konfigurasi Data _BN_ Status karyawan";

if($_SERVER['REQUEST_METHOD'] == "POST" ):
	switch($task){
		case   "edit_status_kekaryawanan_page" :
			$validatepost = valid_status_kekaryawanan($id);
			if($validatepost){
				$errors = message_multi_error($validatepost);
				$content = $errors;
				$content .= form_status_kekaryawanan($id);
				generate_my_web($content,"","plain.php");
				exit; 
			}else{
				submit_status_kekaryawanan($id);
				$content =  "Updated";
				generate_my_web($content,"","plain.php");
				exit;
		     }
			break;
	}

else: 	
	if($task == "edit_status_kekaryawanan"){ 
		$title= ($id > '0' ) ?  "Perubahan Data" : "Tambah Data";
		facebox_page('index.php?com=org_status_karyawan&task=edit_status_kekaryawanan_page&id='.$id , $title , 200	); 
	}elseif($task == "edit_status_kekaryawanan_page"){ 
		$content  = form_status_kekaryawanan($id);
		generate_my_web($content,"","plain.php");
		exit; 
	}elseif($task == 'delete_status_kekaryawanan'){ // DELETE ITEM	
		remove_status_kekaryawanan($id);
		my_direct('index.php?com=org_status_karyawan');
	}else{
		$pagename = "Daftar status karyawan";
		load_facebox_script();
		$view =  list_status_kekaryawanan(); 
		
	}
endif; 
$content = spliter_browser( $view , $pagename ,'index.php?com=org_status_karyawan&task=edit_status_kekaryawanan');
generate_my_web($content, $modulname );
?>